import request from '@/utils/request'

//获取分类选项
export function getCategoryList() {
  return request({
    url: '/admin/category/option',
    method: 'get',
  })
}

//获取分类列表（包含文章数量）
export function getCategoryListWithArticle(queryParams) {
  return request({
    url: '/admin/category/list',
    method: 'get',
    params: queryParams
  })
}

//删除分类
export function deleteCategory(categoryIdList) {
  return request({
    url: '/admin/category/delete',
    method: 'delete',
    data:categoryIdList
  })
}

//添加分类
export function addCategory(category) {
  return request({
    url: '/admin/category/add',
    method: 'post',
    data:category
  })
}

//修改分类
export function updateCategory(category) {
  return request({
    url: '/admin/category/update',
    method: 'put',
    data:category
  })
}


// 获取分类列表
export function getCategoryListDasboard(){
  return request({
    url:'/category/list',
    method:'get',
  })
}